#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

#define ll long long 

int main() {
    int n, k;
    cin >> n >> k;
    int happy[n];
    int set[n];
    for (int i = 0; i < n; i++)
    {
        cin >> happy[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> set[i];
    }
    int left = 0;
    int right = 0;
    ll happy_max = 0;
    ll set_max = 0;
    int day = 0;
    ll happynew = 0;
    ll setnew = 0;
    int l = 0;
    while (right < n)
    {
        happynew += happy[right];
        setnew += set[right];
        l++;
        if (l == k)
        {
            if (happy_max < happynew)
            {
                happy_max = happynew;
                set_max = setnew;
                day = left + 1;
            }
            else if (happy_max == happynew && set_max > setnew)
            {
                happy_max = happynew;
                set_max = setnew;
                day = left + 1;
            }
            happynew -= happy[left];
            setnew -= set[left];
            left++;
            l--;
        }
        right++;
    }
    cout << day << endl;
    return 0;
}

int main() {
    string str;
    cin >> str;
    int n = str.size();
    for (int i = 0; i < n; i++)
    {
        if ((str[i] - '0') % 2 == 0)
        {
            str[i] = '0';
        }
        else
        {
            str[i] = '1';
        }
    }
    cout << stoi(str) << endl;
    return 0;
}


const int N = 1e6 + 10;
int n, m;
long long row[N];
long long col[N];


int main()
{
    cin >> n >> m;
    int board[n][m];
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            cin >> board[i][j];
            row[i] += board[i][j];
            col[j] += board[i][j];
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            cout << row[i] + col[j] - board[i][j] << " ";
        }
        cout << endl;
    }
    return 0;
}


class Solution {
public:
    string compressString(string param) {
        // write code here
        int n = param.size();
        int prev = 0;
        string ret;
        while (prev < n)
        {
            int k = 0;
            while (prev + k < n && param[prev] == param[prev + k])
            {
                k++;
            }
            ret += param[prev];
            int st = k;
            if (k > 1)
            {
                string p;
                while (k > 0)
                {
                    p += (k % 10 + '0');
                    k /= 10;
                }
                reverse(p.begin(), p.end());
                ret += p;
            }
            prev += st;
        }
        return ret;
    }
};

int n, k;
#define ll long long
struct cmp
{
    bool operator()(const pair<int, int> x1, const pair<int, int> x2)
    {
        if (x1.second == x2.second)
        {
            return x1.first < x2.first;
        }
        return x1.second > x2.second;
    }
};

int main() {
    cin >> n >> k;
    vector<int> a(n);
    vector<int> b(n);
    vector<pair<int, int>> c(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> b[i];
    }
    for (int i = 0; i < n; i++)
    {
        c[i] = { a[i],b[i] };
    }
    sort(c.begin(), c.end(), cmp());
    ll sum1 = 0;
    ll sum2 = 0;
    int cnt = 0;
    while (k--)
    {
        sum1 += c[cnt].first;
        sum2 += c[cnt].second;
        cnt++;
    }
    cout << sum1 << " " << sum2 << endl;
    return 0;
}

class Solution {
public:
    int knapsack(int V, int n, vector<vector<int> >& vw) {
        // write code here
        int dp[1010] = { 0 };
        for (int i = 0; i < n; i++)
        {
            for (int j = V; j >= vw[i][0]; j--)
            {
                dp[j] = max(dp[j], dp[j - vw[i][0]] + vw[i][1]);
            }
        }
        return dp[V];
    }
};